import userRole from "@/access/permissionEnum";
import { LoginUserVO } from "../../generated";

const checkRole = (
  loginUser: LoginUserVO,
  needPermission = userRole.NOT_LOGIN
) => {
  if (needPermission == userRole.NOT_LOGIN) {
    return true;
  }
  if (loginUser.userRole == needPermission) {
    return true;
  }
  return false;
};

export default checkRole;
